#if !defined(METAL_HPP)
#define METAL_HPP

#include "utilities.hpp"
#include "Material.hpp"

// 全反光金属材质
class Metal :public Material {
private:
    // 反射率
    Eigen::Vector3f albedo;
    // 粗糙程度
    float fuzz;

public:
    Metal() :albedo(0.5, 0.5, 0.5) {}
    Metal(const Eigen::Vector3f& albedo, float f = 0) :albedo(albedo), fuzz(f < 1 ? f : 1) {}
    // 获取光线打在该材质上散射光线的方向和衰减率
    virtual bool scatter(
        const Ray& rayIn, const ShadePayload& payload,
        Ray& rayOut, Eigen::Vector3f& attenuation
    )const override;
};

#endif // METAL_HPP
